import request from '@/utils/request'

// 查询党员论坛帖列表
export function listPost(query) {
  return request({
    url: '/community/cpc/post/list',
    method: 'get',
    params: query
  })
}

// 查询党员论坛帖详细
export function getPost(postId) {
  return request({
    url: '/community/cpc/post/' + postId,
    method: 'get'
  })
}

// 新增党员论坛帖
export function addPost(data) {
  return request({
    url: '/community/cpc/post',
    method: 'post',
    data: data
  })
}

// 修改党员论坛帖
export function updatePost(data) {
  return request({
    url: '/community/cpc/post',
    method: 'put',
    data: data
  })
}

// 删除党员论坛帖
export function delPost(postId) {
  return request({
    url: '/community/cpc/post/' + postId,
    method: 'delete'
  })
}

// 查询党员论坛评论列表
export function listComment(query) {
  return request({
    url: '/community/cpc/post/comment/list',
    method: 'get',
    params: query
  })
}
// 删除党员论坛评论
export function delComment(commentId) {
  return request({
    url: '/community/cpc/post/comment/' + commentId,
    method: 'delete'
  })
}
//
// // 获取某个帖子下的全部评论
// export function listCommentByPostId(postId) {
//   return request({
//     url: '/community/cpc/comment/' + postId,
//     method: 'get'
//   })
// }
